
from os import remove

from numpy.ma.core import append


class AddStudent:


    def  add_student(self, dict_student,student_list): # 调用“添加学生”函数
        student_list.append(dict_student)
        print("添加成功")
        return student_list
    def  del_student(self,user_choice,student_list,dict_student):# 调用“删除学生”函数
        student_list.remove(dict_student[user_choice])
        print("删除成功")


    def modify_student(self,user_choice,student_list,dict_student):#调用“修改学生”函数
        user_in=input("输入修改谁")
        if user_choice in student_list:
            student_list.remove(dict_student[user_choice])
            dict_student.append(input("输入你要修改的名字"))
            student_list.append(dict_student)
        else:
            print("没有找到输入的学生名")

    def search_student(self,student_list,user_input,dict_student):
        if user_input in dict_student['name']:
            print(dict_student['name'])






    def show_all_students(self,student_list):
        print(student_list)
        pass



addstudent=AddStudent()



